<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateQhRanksTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('qh_ranks', function (Blueprint $table) {
            $table->id();
            $table->integer('userId', false, true)->comment('用户ID');
            $table->decimal('duration')->nullable(0)->comment('答题时长');
            $table->integer('rightCount', false, true)->nullable(0)->comment('答对数量');
            $table->integer('wrongCount', false, true)->nullable(0)->comment('答错数量');
            $table->timestamps();
        });

        DB::statement("ALTER TABLE qh_ranks comment '启航排名'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('qh_ranks');
    }
}
